<template>
	<div class="card">
		<el-button class="button_list" type="primary" @click="goPage">新窗口打开页面</el-button>
		<h4>同意窗口打开不同页面</h4>
		<el-button class="button_list" type="primary" @click="goPageOther(demeData[0].name)">家纺-毛巾</el-button>
		<el-button class="button_list" type="primary" @click="goPageOther(demeData[1].name)">家纺-床品</el-button>
		<el-button class="button_list" type="primary" @click="goPageFun(demeData[1].name)">详情-床品</el-button>
		<el-button class="button_list" type="primary" @click="goPageFun(demeData[0].name)">详情-毛巾</el-button>
		
		<el-button class="button_list" type="primary" @click="state.add = true">详情-毛巾</el-button>
		
		
	</div>
</template>
<script setup lang="ts" name="alonePage">
	import { encode, encodeURL } from "js-base64";
	import { ref,reactive } from "vue";
	import { useRouter } from "vue-router";
	
	
	const router = useRouter();
	const demeData = ref(
		[
			{
				name: "毛巾"
			},
			{
				name: "床品"
			}
		]
	)
	const openHrefUrl = router.resolve({ //使用resolve
		name: 'mdiIcon',    //这里是跳转页面的name
		path: '/icon'     //这里是跳转页面的path地址
	})
	const goPage = () => {
		window.open(openHrefUrl.href, '_blank')
	}
	const goPageFun = (pageName) => {
		router.push(`/alone/caseDetail?open=false&name=${pageName}`);
	}
	const goPageOther = (pageName) => {
		router.push(`/alone/case?open=true&name=${pageName}`);
	}
</script>

<style scoped lang="scss">
	@import "./index.scss";
</style>